package com.tobby.camel.camelinaction.chapter6.notify;

/**
 * Just a simple order service
 * 
 * @author Administrator
 */
public class OrderService {

	public boolean validateOrder(String order) {
		// validate order
		return order.startsWith("123");
	}

	public String processOrder(String order) {
		// to simulate exception been thrown
		if (order.endsWith("9999")) {
			throw new IllegalArgumentException("Forced error");
		}

		// simulate processing order
		return "OK," + order;
	}

}
